/**
 * Created by yermek on 2017/12/23.
 */
// Tab切换js

$(document).ready(function () {
    // 导航区jq
    $('.center li').mouseover(function () {
        $(this).addClass("hover").siblings().removeClass("hover")
    });
    $('.center ').mouseout(function () {
        $(this).children('li').removeClass("hover")
    });

});
//    页面登录注册弹出框
function popup(popupName) {
    var _scrollHeight = $(document).scrollTop(),//获取当前窗口距离页面顶部高度
        _windowHeight = $(window).height(),//获取当前窗口高度
        _windowWidth = $(window).width(),//获取当前窗口宽度
        _popupHeight = popupName.height(),//获取弹出层高度
        _popupWeight = popupName.width();//获取弹出层宽度
    _posiTop = (_windowHeight - _popupHeight) / 2 + _scrollHeight;
    _posiLeft = (_windowWidth - _popupWeight) / 2;
    popupName.css({"left": _posiLeft + "px", "top": _posiTop + "px", "display": "block"});//设置position
}
$(function () {
    $(".btn1").click(function () {
        popup($("#sigin"));
        $(".covers").show();
    });
    $(" #sigin i").click(function () {
        $(".covers").hide();
        $("#sigin").hide();
    });
    $(".signed").mouseover(function () {
        $(this).addClass("active");
        $(".signed ul").show();
    });
    $(".signed ul li").mouseover(function () {
        $(this).addClass("hover").siblings().removeClass("hover");
    });
    $(".signed ").mouseout(function () {
        $(this).removeClass("active");
        $(".signed ul").hide();
    })
});
